import ajax from "./ajax";
const baseUrl = '/api1'
// 1、根据经纬度获取位置详情
export const reqAddress=(latitude,longitude)=>ajax(`${baseUrl}/position/${latitude},${longitude}`)
// 2、获取食品分类列表
export const reqFoodCategorys = () => ajax(baseUrl+'/index_category')
// 3、根据经纬度获取商铺列表
export const reqShops = (longitude, latitude) => ajax(baseUrl+'/shops', {longitude, latitude})

// 4、根据经纬度和关键字搜索商铺列表

// 6、用户名密码登陆
export const reqPwdLogin = ({name, pwd, captcha}) => ajax(baseUrl+'/login_pwd', {name, pwd, captcha}, 'POST')
// 7、发送短信验证码
export const reqSendCode = (phone) => ajax(baseUrl+'/sendcode', {phone})
// 8、手机号验证码登陆
export const reqSmsLogin = (phone, code) => ajax(baseUrl+'/login_sms', {phone, code}, 'POST')
// 9、根据会话获取用户信息
export const reqUserInfo = () => ajax(baseUrl+'/userinfo')
// 10、用户登出
export const reqLogout = () => ajax(baseUrl+'/logout')

//获取商家信息
export const reqShopInfo = ()=>ajax('/info')
//获取商家评价
export const reqShopRatings = ()=>ajax('/ratings')
//获取商家商品信息
export const reqShopGoods = ()=>ajax('/goods')